let fs = require('fs');

let ws = fs.createWriteStream('hello6.txt');

//使用once 函数监听打开事件和关闭事件
ws.once('open',()=>console.log('open'))
ws.once('close',()=>console.log('close'))

//写入内容
ws.write('你好')
ws.write('好个屁')

//关闭流
ws.end()
